package br.com.vertigo.sgci.util;

import java.util.Comparator;

import org.jboss.seam.annotations.Name;

import br.com.vertigo.sgci.entity.Itemrdv;

@SuppressWarnings("unchecked")
@Name("rdvitemNomeComparator")
public class RdvItemNomeComparator implements Comparator
{
    public int compare(Object o1, Object o2) {
    	 int result;
    	 Itemrdv irdv1, irdv2;
         irdv1 = (Itemrdv) o1;
         irdv2 = (Itemrdv) o2;
         result = irdv1.getProjetotipoitem().getTipoitem().getNome().compareTo(irdv2.getProjetotipoitem().getTipoitem().getNome());
         if (result != 0){ 
        	 return result;
         }
         return 0;
    }
}